Page({

  data: {
      hisDetail: [],
      id: ''
  },

  onLoad: function(options) {
    this.setData({ 
      id: options.id
    });
    this.getHistory();
  },

  // 历史上的今天
  getHistory() {
    let that = this;
    wx.request({
      url: 'https://v.juhe.cn/todayOnhistory/queryDetail.php',
      data: {
        e_id: this.data.id,
        key: '8cb1a720e0505e4c766ab65e61eaa839'
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      method: 'GET', //（需大写）有效值：OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
      dataType: 'json',
      responseType: 'text',// 设置响应的数据类型。合法值：text、arraybuffer
      success: function(res) {
        that.setData({ 
          hisDetail: res.data.result
        })
        console.log(res);
      },
      fail: function(res) {
        console.log(res.data.msg);
      }
    })
  },

  onReady: function() {

  },

  onShow: function() {

  },

  onHide: function() {

  },

  onUnload: function() {

  },

  onPullDownRefresh: function() {

  },

  onReachBottom: function() {

  },

  onShareAppMessage: function() {

  }
});